<!--
 * @Author: your name
 * @Date: 2020-12-28 17:53:01
 * @LastEditTime: 2020-12-29 14:27:17
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \basicvue\vuehtml\vueindex.html
-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../assets/css/common.css">
    <link rel="stylesheet" href="../assets/css/vue.css">
    <script src="../assets/js/vue.js"></script>
</head>
<body>
    <author></author>
    <hr>
    <div id="aut"></div>
    <liuhaoMY></liuhaoMY>
    <script>
       var authorExtend = Vue.extend({
           template:"<p><a :href='authorUrl'>{{ authorName }}</a></p>",
           data:function(){
               return {
                authorName:'LiuHouse',
                authorUrl : 'http://www.houdunren.com'
               }
           }
       });

       //编写一个刘皓的名言警句
       var LiuhaoMingyanExtend = Vue.extend({
           template:"<h3>{{ liuhouseMY }}</h3>",
           data:function(){
               return {
                liuhouseMY : '到哪里说哪里话,你只需要努力,剩下的交给命运...'
               }
           }
       });

       //当声明好之后的html标签还是没有作用的,因为扩展构造器是需要挂载的，我们再进行一次挂载
       new authorExtend().$mount('author');

       //挂载到普通标签上
       new authorExtend().$mount('#aut');

       //进行挂载
       new LiuhaoMingyanExtend().$mount('liuhaoMY');

    </script>
</body>
</html>